
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

import { RunningService } from '../services/count';
import { DevicesList } from '../domain/devices-list';

@Component({
  selector: 'ree-status',
  templateUrl: './status.component.html',
  styleUrls: ['./status.component.scss']
})
export class StatusComponent implements OnInit {

  selectedOption;
  searchOptions = [
    { value: '空压机', label: '空压机' },
    { value: '干燥机', label: '干燥机' },
    { value: '冷冻机', label: '冷冻机' }
  ];

  filter = {
    deviceType: '',
    delarAccounts: '',
    customerAccounts: '',
    deviceSidOrModel: ''
  }

  devicesList = [];

  constructor(private runningService: RunningService, public router: Router) {
  }

  ngOnInit() {
    this.runningService.getDevicesList().then(data => this.devicesList = data);
  }

  ngOnDestroy() {
  }

  skipTodeviceDetail(device) {
    this.router.navigate(["/work/running/detail"])
  }

}

